package com.imooc.bilibili.domain.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * 用户信息
 *
 * @author gcq
 * @Create 2022-05-23
 */
@Document(indexName = "user-infos")
@Data
@TableName(value = "t_user_info")
public class UserInfo {

    @Id
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 关联 user id
     */
    @TableField(value = "userId")
    private Long userId;
    @Field(type = FieldType.Text)
    private String nick;
    private String avatar;
    private String sign;
    private String gender;
    private String birth;
    @Field(type = FieldType.Date)
    @TableField(value = "createTime")
    private Date createTime;
    @Field(type = FieldType.Date)
    @TableField(value = "updateTime")
    private Date updateTime;
    /**
     * 是否关注
     */
    @TableField(exist = false)
    private Boolean followed;
}